﻿using System.Windows;
using System.Windows.Controls;
using LiveTiss.Schemas;

namespace LiveTiss.Guias.UserControls
{
    public partial class Contratado : UserControl
    {
        #region Value

        public static readonly DependencyProperty ValueProperty = DependencyProperty.Register("Value",
            typeof(ct_contratado), typeof(Contratado), new PropertyMetadata(null));

        public ct_contratado Value
        {
            get { return (ct_contratado)GetValue(ValueProperty); }
            set { SetValue(ValueProperty, value); }
        }

        #endregion

        public Contratado()
        {
            this.DataContext = this;

            if (this.Value == null)
            {
                this.Value = new ct_contratado()
                {
                    enderecoContratado = new ct_endereco()
                    {
                        cep = string.Empty,
                        codigoIBGEMunicipio = string.Empty,
                        codigoUF = st_UF.AC,
                        complemento = string.Empty,
                        logradouro = string.Empty,
                        municipio = string.Empty,
                        numero = string.Empty,
                        tipoLogradouro = st_tipoLogradouro.Item001
                    },
                    identificacao = new ct_identificacaoPrestadorExecutante()
                    {
                        ItemValue = string.Empty,
                        ItemElementName = ItemChoiceType.CNPJ
                    },
                    nomeContratado = string.Empty,
                    numeroCNES = string.Empty
                };
            }

            InitializeComponent();
        }
    }
}
